import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import "@/assets/main.css";
import pinia from "@/stores/index";
import i18n from "./locales";
import dayjs from "dayjs";
import "dayjs/locale/es-mx";
dayjs.locale("es-mx");
// import PerfectScrollbar from 'vue3-perfect-scrollbar'
// import 'vue3-perfect-scrollbar/dist/vue3-perfect-scrollbar.css'

/**
 * 生成环境不打印控制台 development  production
 */
if (import.meta.env.MODE == "production") { 
  console.log = function () {};
  console.error = function () {};
  console.dir = function () {};

  // (() => {
  //   function block() {
  //     if (
  //       window.outerHeight - window.innerHeight > 200 ||
  //       window.outerWidth - window.innerWidth > 200
  //     ) {
  //       document.body.innerHTML = "检测到非法调试,请关闭后刷新重试!";
  //     }
  //     setInterval(() => {
  //       (function () {
  //         return false;
  //       }
  //         ["constructor"]("debugger")
  //         ["call"]());
  //     }, 50);
  //   }
  //   try {
  //     block();
  //   } catch (err) {}
  // })();
}

createApp(App)
  .use(router)
  .use(pinia)
  .use(i18n)
  // .use(PerfectScrollbar)
  .mount("#app");
